﻿using System.Runtime.InteropServices;
using Izhgtu.SandcastlePackage;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Project;
using Microsoft.VisualStudio.Shell.Interop;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
using IServiceProvider = System.IServiceProvider;

namespace Izhgtu.SandcastlePackage
{
    /// <summary>
    /// Creates Sandcastle Projects
    /// </summary>
    [Guid(GuidList.guidSandcastleProjectFactoryString)]
    public class SandcastleProjectFactory : ProjectFactory
    {
        #region ctor
        /// <summary>
        /// Constructor for PythonProjectFactory
        /// </summary>
        /// <param name="package">the package who created this object</param>
        public SandcastleProjectFactory(SandcastlePackage package)
            : base(package)
        {
        }
        #endregion

        #region overridden methods
        ///// <summary>
        ///// Creates the Python Project node
        ///// </summary>
        ///// <returns>the new instance of the Python Project node</returns>
        protected override ProjectNode CreateProject()
        {
            SandcastleProjectNode project = new SandcastleProjectNode(this.Package as SandcastlePackage);
            project.SetSite((IOleServiceProvider)((IServiceProvider)this.Package).GetService(typeof(IOleServiceProvider)));
            return project;
        }
        #endregion
    }

    /// <summary>
    /// This class is a 'fake' project factory that is used by WAP to register WAP specific information about
    /// IronPython projects.
    /// </summary>
    [GuidAttribute("17C886C2-BE01-4D39-AED0-28B45B7DBB00")]
    public class WAPythonProjectFactory { }


}
